App({
  onLaunch() {
    //获取用户授权信息
    wx.getSetting({
      success: res => {
        if (res.authSetting['scope.userInfo']) {
          //用户已经授权，通过wx.getUserInfo可以获取用户信息
          wx.getUserInfo({
            success: res => {
              this.globalData.userInfo = res.userInfo;
              if (this.myInfo) {
                this.myInfo(res)
              }

            }
          })
        }
      }
    })


  },
  // myInfo(res) {

  // },
  globalData: {
    userInfo: null
  }
})